home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / interp / obj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  2.2 KB  |  83 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: obj.c,v 1.11 94/11/28 08:28:36 wlott Exp $
  27. *
  28. * This file contains <object>.
  29. *
  30. \**********************************************************************/
  31.  
  32. #include "../compat/std-c.h"
  33.  
  34. #include "mindy.h"
  35. #include "class.h"
  36. #include "bool.h"
  37. #include "list.h"
  38. #include "def.h"
  39. #include "gc.h"
  40. #include "num.h"
  41. #include "obj.h"
  42.  
  43. obj_t obj_ObjectClass = 0;
  44.  
  45. static obj_t dylan_object_class(obj_t object)
  46. {
  47.     return object_class(object);
  48. }
  49.  
  50. static obj_t dylan_object_address(obj_t object)
  51. {
  52.     return make_bignum((long)object);
  53. }
  54.  
  55.  
  56. /* GC stuff. */
  57.  
  58. void scavenge_obj_roots(void)
  59. {
  60.     scavenge(&obj_ObjectClass);
  61. }
  62.  
  63.  
  64. /* Init stuff. */
  65.  
  66. void make_obj_classes(void)
  67. {
  68.     obj_ObjectClass = make_abstract_class(FALSE);
  69. }
  70.  
  71. void init_obj_classes(void)
  72. {
  73.     init_builtin_class(obj_ObjectClass, "<object>", NULL);
  74. }
  75.  
  76. void init_obj_functions(void)
  77. {
  78.     define_function("object-class", list1(obj_ObjectClass), FALSE, obj_False,
  79.             FALSE, obj_ClassClass, dylan_object_class);
  80.     define_function("object-address", list1(obj_ObjectClass), FALSE, obj_False,
  81.             FALSE, obj_FixnumClass, dylan_object_address);
  82. }
  83.